package com.example.runningdemo.designModel;

/**
 * @program: Running-Demo
 * @description: 饿汉模式
 * @author: kangwei
 * @create: 2024-08-07 09:11
 **/
public class HungrySingleton {

    // 创建实例对象
    private static HungrySingleton INSTANCE = new HungrySingleton();

    // 私有构造方法
    private HungrySingleton() {
    }


    // 获取实例对象
    public static HungrySingleton getInstance() {
        return INSTANCE;
    }

    public static void main(String[] args) {
        System.out.println(getInstance());
    }

}
